import sql from 'mssql';
import { dbUri, database, dbCipher } from '../config';

export const conn = new sql.ConnectionPool({
  server: dbUri,
  user: database,
  password: dbCipher,
  database,
  options: {
    encrypt: true,
    trustServerCertificate: true
  }
});

conn.connect().then(() => {
  console.log('数据库连接成功！');
}).catch((err) => {
  console.log('数据库连接失败！', err);
});
